package com.qgzj.controller;

import com.qgzj.common.utils.RandomIDUtils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;

/**
 * @ClassName test
 * @Description TODO
 * @DATE 2019-11-13 22:36
 **/
public class test {

    public static String getId() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
        String t = sdf.format(new Date());
        System.out.println(t);
        String uuid = UUID.randomUUID().toString();
        String[] uuids = uuid.split("-");
        System.out.println(uuids[3]);
        System.out.println(uuids[4]);
        return t + uuids[3].substring(1) + uuids[4];
    }

    public static void main(String[] args) {
//        System.out.println(getId());
        /*MaterialRequest materialRequest = new MaterialRequest();
        materialRequest.setMaterialName("教材一");
        materialRequest.setStage("小学");
        materialRequest.setCourseIntroduction("这是一本神奇的书");
        materialRequest.setCoverPicUrl("http://picurl");
        materialRequest.setVolumeNum(1);
        materialRequest.setPageNum(100);
        materialRequest.setPublishingHouse("人民出版社");
        DecimalFormat df = new DecimalFormat();
        String style = "0.00";
        df.applyPattern(style);
        materialRequest.setOriginalPrice(new BigDecimal(df.format(34.21)));
        materialRequest.setCurrentPrice(new BigDecimal(df.format(12.33)));
        String s = JSON.toJSONString(materialRequest);
        System.out.println(s);*/

//        String url = "https://note.youdao.com/yws/public/resource/5385338be6152c064229cf707b4aa43f/xmlnote/WEBRESOURCE04372dcf0d9058032652212c2dfe59fe/4081";
//
//        OcrService ocrService = new OcrService();
//        AipOcr ocrClient = ocrService.getOcrClient();
//        String res = ocrService.bdCommonOcr(ocrClient, url);
//        System.out.println(res);

        String s = RandomIDUtils.getRandomStr(2) + DateUtils.getLongFormatNow() + RandomIDUtils.getRandomStr(3);
        System.out.println(s);
    }
}
